package com.aurora.app.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.aurora.base.entity.BaseEntity;

@Entity
@Table(name = "tb_weixin_user_account")
public class UserAccount extends BaseEntity {
	// 对应的微信用户
	private User user;
	// 账户余额
	private BigDecimal balance = BigDecimal.ZERO;
	// 历史金额 （账户余额+提现历史）
	private BigDecimal sumBalance= BigDecimal.ZERO;
	// 提现历史
	private BigDecimal balanceHistory= BigDecimal.ZERO;
	// 加密签名
	private String fingerprint;

	// 预到帐金额
	private BigDecimal freezeBalance= BigDecimal.ZERO;

	@Column(name = "F_FREEZEBALANCE")
	public BigDecimal getFreezeBalance() {
		return this.freezeBalance;
	}
	public void setFreezeBalance(BigDecimal freezeBalance) {
		this.freezeBalance = freezeBalance;
	}
	@ManyToOne(cascade = {CascadeType.REFRESH}, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "F_WEIXINPUBLICUSER")
	public User getUser() {
		return this.user;
	}
	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "F_BALANCE")
	public BigDecimal getBalance() {
		return this.balance;
	}
	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}
	@Column(name = "F_SUMBALANCE")
	public BigDecimal getSumBalance() {
		return this.sumBalance;
	}
	public void setSumBalance(BigDecimal sumBalance) {
		this.sumBalance = sumBalance;
	}
	@Column(name = "F_BALANCEHISTORY")
	public BigDecimal getBalanceHistory() {
		return this.balanceHistory;
	}
	public void setBalanceHistory(BigDecimal balanceHistory) {
		this.balanceHistory = balanceHistory;
	}
	
	@Column(name = "F_FINGERPRINT", length = 1000)
	public String getFingerprint() {
		return this.fingerprint;
	}
	public void setFingerprint(String fingerprint) {
		this.fingerprint = fingerprint;
	}

}
